#ifndef PLOTDATA_H
#define PLOTDATA_H

#include <list>
#include <string>
#include "interfaces.h"

const int MaxCurveCount = 20;
const int MaxDataCount = 10000;

class PlotData: public PlotObservable
{
public:
    PlotData();
    ~PlotData();
    void Initialize();
    void addData(double x[], double y[]);
    void addData(double x, double y, int curve);
    void addCurve(std::string cur_name);
    int getCurPos(int curve);
    void registerObserver(PlotObserver *observer);
    void removeObserver(PlotObserver *observer);
    void notifyObservers();
    double ** getXData();
    double ** getYData();
    int * getPos();
    int getCurveCount();
	std::string getCurveName(int cur_id);
	int getCurveId(std::string cur_name);

private:
	int m_baseTime;
    int m_curveCount;
    double *m_xdata[MaxCurveCount];
    double *m_ydata[MaxCurveCount];
	std::string m_curveNames[MaxCurveCount];
    int m_pos[MaxCurveCount];
    std::list<PlotObserver *> *m_observers;
};

#endif // PLOTDATA_H
